package com.example;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

/**
 * 继承 SpringBootServletInitializer 重写其configure()方法
 */
@SpringBootApplication
public class AppRun extends SpringBootServletInitializer {

    public static void main(String[] args) {
        SpringApplication.run(AppRun.class, args);
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        // 传入SpringBoot的主程序类
        return builder.sources(AppRun.class);
    }

}
